<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>


    // 持有 注册 执行
    /*new Promise((resolve, reject)=>{
        setTimeout(()=>{
            console.log(1);
            resolve()
        },1000);
    }).then(()=>{
        console.log(2)
    })
    console.log(3)*/


    //3 1 2
    (async function test() {
        await new Promise((resolve, reject)=>{
            setTimeout(()=>{
                console.log(1);
                resolve()
            },1000);
        })
        console.log(2)
    })()
    console.log(3)




</script>
</html>